home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20031118-20041115
/
000159_fdc@columbia.edu_Tue Mar 30 10:02:35 2004.msg
< prev
next >
Wrap
Internet Message Format
|
2004-11-14
|
4KB
Path: newsmaster.cc.columbia.edu!not-for-mail
From: Frank da Cruz <fdc@columbia.edu>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Trying to connect to a device console via COM 1 (no dialing modem)
Date: 30 Mar 2004 14:57:43 GMT
Organization: Columbia University
Lines: 87
Message-ID: <slrnc6j2n7.gj9.fdc@sesame.cc.columbia.edu>
References: <9c258be2.0403292240.2e00c890@posting.google.com> <9c258be2.0403300608.46d5097f@posting.google.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: sesame.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1080658663 14729 128.59.59.56 (30 Mar 2004 14:57:43 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 30 Mar 2004 14:57:43 GMT
User-Agent: slrn/0.9.8.0 (SunOS)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14871
On 2004-03-30, Klein Bill <collector59ca@yahoo.com> wrote:
> I'm trying to connect to the ASCII terminal of a manageable router
> device which is directly connected to my serial port COM 1.
> I'm using the following Kermit script:
> ...
> When running this script, kermit stays in command mode but I see no
> dialog between it and the router even though I've used "set input
> echo on".
>
> If I press Alt-x the terminal window is opened and my command is
> finally sent (but I remain in terminal mode).
>
> How can I make Kermit show me the interaction in command mode ?
>
By having an INPUT command active to process the incoming material.
> I've made a FINAL UPDATE...
>
> ****************************************
> set input echo on
> set modem type none
> set carrier-watch off
> set line 1
> set serial 8n1
> set speed 115200
> output \13
> input 2 console>
> lineout show config
> INPUT -1 STRING_THAT_NEVER_COMES
> *****************************************
>
> And this time Kermit showed me the full interaction in command mode.
> Why isn't it possible to obtain the interaction dialog in command mode
> without having an endless waiting condition at the end of the script ?
> Why set input echo on is not enough? If it is possible to get the
> interaction in command mode without the "STRING_THAT_NEVER_COMES" part
> I'd like to know the way.
>
SET INPUT ECHO ON is a command that makes the INPUT command echo whatever
comes in while it is running. If the INPUT command is not running, it
won't be able to echo anything. The first version of your script ended
with "lineout show config", which sends "show config" (and a line-end)
to the router, but then included no further commands to read its response.
In fact the script simply stopped at that point, because it had executed
its final command.
Adding the INPUT command to the end of the script, as you have discovered,
makes it read the response and, when INPUT ECHO is ON, also display it on
the screen as desired.
The real question is: how should the INPUT command terminate? You have
the following choices:
. Never (use -1 as a timeout and specify a string that will never come).
In this case you can still interrupt it from the keyboard. Example:
INPUT -1 STRING_THAT_WILL_NEVER_COME
. When a specified string comes before a given time limit (e.g. the
next router prompt). Example:
INPUT 20 "\13\10> " ; Wait up to 20 sec for router prompt
IF FAIL ... ; What to do if it didn't come
. When the specified time limit expires (and the given string did not
comes) -- same as the previous example, except the IF FAIL commands
are executed.
. When a specified string is already waiting in the input buffer:
INPUT 0 OK ; "OK" must already be there.
IF FAIL...
You can also give a time-of-day instead of a number of seconds, to make
INPUT wait until the given time:
INPUT 23:59:59 "Operation Complete"
IF FAIL ...
And as you probably know, you can also have INPUT look for a pattern
rather than a literal string by using \fpattern() as or in the search
target.
And finally you can use MINPUT instead of INPUT to specify multiple
search targets, possibly including patterns.
- Frank